package com.scujj.cs6.model.dto.comment;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
@Schema(name = "评论数据传输对象", description = "评论数据传输对象")
public class CommentDTO {

    @Schema(description = "评论父ID，可不要，如一定要填写，只能是-1或者有效值" ,requiredMode = Schema.RequiredMode.NOT_REQUIRED , example = "-1")
    private Long parentId;

    @Schema(description = "回答ID" ,requiredMode = Schema.RequiredMode.REQUIRED , example = "1905886629909598209")
    @NotNull(message = "回答ID不能为空")
    private Long answerId;

    @Schema(description = "问题ID" ,requiredMode = Schema.RequiredMode.REQUIRED , example = "1905886019822854145")
    private Long questionId;

    @Schema(description = "评论内容" ,requiredMode = Schema.RequiredMode.REQUIRED , example = "这是一个评论")
    @NotNull(message = "评论内容不能为空")
    @NotBlank(message = "评论内容不能为空")
    @Size(min = 1, max = 255, message = "评论内容长度必须在1-255之间")
    private String content;
}
